<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

// Load the tooltip behavior.
JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('behavior.modal');
JHtml::_('formbehavior.chosen', 'select');
		$db	 = &JFactory::getDBO();
		$user   = & JFactory::getUser();
	    $uid  	= $user->get('id');
		$query = $db->getQuery(true);
		// Select all records from the user profile table where key begins with "custom.".
		// Order it by the ordering field.
		$query->select('*');
		$query->from('#__contacts');
		$query->where('user_id='.$uid);
		// Reset the query using our newly populated query object.
		$db->setQuery($query);
		$results = $db->loadObjectList();
		foreach($results as $row){
			$policy 		 = $row -> policy_client;
			$policy_status  = $row -> policy_status;
		}
?>
	<table class="table table-striped">
		<thead>
			<tr>
				<th width="1%" class="nowrap center">
					<input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" />
				</th>
				<th width="15%" class="left">
					<?php echo JHtml::_('grid.sort', 'NAME', 'a.name', $listDirn, $listOrder); ?>
				</th>
				<th width="15%" class="nowrap center">
					<?php echo JHtml::_('grid.sort', 'EMAIL', 'a.username', $listDirn, $listOrder); ?>
				</th>
				<th width="15%" class="nowrap center">
					<?php echo JHtml::_('grid.sort', 'SUBJECT', 'a.block', $listDirn, $listOrder); ?>
				</th>
				<th class="nowrap center">
					<?php echo JHtml::_('grid.sort', 'BODY', 'a.activation', $listDirn, $listOrder); ?>
				</th>
				<th width="10%" class="nowrap center">
					<?php echo JText::_('MODIFY'); ?>
				</th>
				<th width="5%" class="nowrap center">
					<?php echo JHtml::_('grid.sort', 'ID', 'a.email', $listDirn, $listOrder); ?>
				</th>
				<th width="5%" class="nowrap center">
					<?php echo JHtml::_('grid.sort', 'FUNCTION', 'a.email', $listDirn, $listOrder); ?>
				</th>
			</tr>
            <?php foreach($results as $row){?>
                <tr>
                  <th class="center"><input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" /></th>
                  <th class="left"><?php echo $row->name;?>&nbsp;</th>
                  <th class="center"><?php echo $row->email;?>&nbsp;</th>
                  <th class="left"><?php echo $row->sub;?>&nbsp;</th>
                  <th class="left"><?php echo $row->body;?>&nbsp;</th>
                  <th class="center"><?php echo $row->modify;?>&nbsp;</th>
                  <th class="center"><?php echo $row->id;?>&nbsp;</th>
                  <th class="center">Delete</th>
              	</tr>
            <?php } ?>
		</thead>
		<tfoot>
			<tr>
				<td colspan="15">
					
				</td>
			</tr>
		</tfoot>
		<tbody>
        	
		</tbody>
	</table>
